
const state = {
  // 配置的 systemList (配置权限的情况)
  systemList:JSON.parse(localStorage.getItem("systemList")) || [],
  // 全部的 systemList (未配置权限的情况)
  allSystemList:JSON.parse(localStorage.getItem("allSystemList")) || [],
  // 用户选中的系统 id
  activeSystem:localStorage.getItem("activeSystem") || "",
  // 用户选中的系统
  chosenSystemList:JSON.parse(localStorage.getItem("chosenSystemList")) || []
}

const mutations = {
  setSystemList: (state, systemList) => {
    console.log("systemList,",systemList)
    state.systemList = systemList
  },
  setAllSystemList: (state, allSystemList) => {
    state.allSystemList = allSystemList
  },
  setChosenSystemList: (state, chosenSystemList) => {
    state.chosenSystemList = chosenSystemList
  },

  setActiveSystem: (state, activeSystem) => {
    state.activeSystem = activeSystem
  },

  clearState:(state)=>{
    state.systemList = []
    state.allSystemList = []
    state.chosenSystemList = []
    state.activeSystem = ""
  }
}

const actions = {


}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

